﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace DARE.Save.DataStructures
{
    public class COctreeData : CPartitionnerData
    {
        public FillMode ItemsFillMode;
        public float LODRange;
        public bool Show;
        public bool ShowItems;
        public BoundingBox AABB;


        public override void FillDataStructure(object partitionner)
        {
            COctree oct = partitionner as COctree;
            if (oct == null)
                return;
            ItemsFillMode = oct.ItemsFillMode;
            LODRange = oct.LODRange;
            Show = oct.Show;
            ShowItems = oct.ShowItems;
            AABB = oct.Root.AABB;
        }

        public override void FillFromDataStructure(out object partitionner, params object[] paramsData)
        {
            partitionner = new COctree(AABB.Min.X, AABB.Max.X, AABB.Min.Y, AABB.Max.Y, AABB.Min.Z, AABB.Max.Z);
            (partitionner as COctree).ItemsFillMode = ItemsFillMode;
            (partitionner as COctree).LODRange = LODRange;
            (partitionner as COctree).Show = Show;
            (partitionner as COctree).ShowItems = ShowItems;
        }
    }
}
